
#if _MSC_VER > 1000
#pragma once
#endif

#ifndef __UFFS_FILESYSTEM_H_
#define __UFFS_FILESYSTEM_H_

#define _NO_CUFFSFILESYSTEM_CLASSOBJECT_
#include "_CUffsFileSystem.h"
#include "stub.h"

#include "uffs\uffs_public.h"

#define MAX_MOUNT_POINT_NAME 32

CarClass(CUffsFileSystem)
{
public:
    CUffsFileSystem();

    ~CUffsFileSystem();

    CARAPI Sync();

    CARAPI GetRoot(
        /* [out] */ IBasicDirectory **ppRoot);

    CARAPI Lookup(
        /* [in] */ WString path,
        /* [out] */ IBasicFile ** ppFile);

    CARAPI GetStat(
        /* [out] */ FileSystemStat * pFileSystemStat);

    CARAPI BindDriver(
        /* [in] */ WString wstrDevName);

    CARAPI UnbindDriver();

    IStub *GetStub();
    void SetStub(IStub *pStub);

private:
    uffs_mountTable       m_conf_mounts;
    uffs_Device           m_conf_devices;
    char                  m_mount_point_name[MAX_MOUNT_POINT_NAME];

    IBasicDirectory      *m_uffsRootDir;
    IStub                *m_pStub;
};

#endif //__UFFS_FILESYSTEM_H_
